<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-show v-if的指令</title>
</head>
<body>
    <div id="app">
        <h1>{{msg}}</h1>
        <img src="./imgs/ComfyUI_00008_lqpop_1760787417.png" alt="" width="50px" v-show=show>
        <!-- <img src="./imgs/ComfyUI_00008_lqpop_1760787417.png" alt="" width="50px" v-if="show"> -->
        <button @click="change">{{btnText}}</button>
    </div>
</body>
<script src="./js/vue.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            msg: 'v-show v-if的指令',
            show:true,
            btnText:"显示"
        },methods:{
            change(){
                this.show = !this.show
                console.log(this.show)
                if(this.show){
                    this.btnText = "隐藏"
                }else{
                    this.btnText = "显示"
                }
            }
        }
    })
</script>
</html>